package com.hotel.app.controller;

import com.hotel.app.service.HotelRoomCollectFeign;
import com.hotel.common.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * --- 天道酬勤 ---
 *
 * @author TRC
 * @date 2024/6/17
 * @desc
 */
@Api(value = "用户收藏房间相关接口")
@RestController
@RequestMapping("/api/hotel/roomCollect")
public class HotelRoomCollectController {

    @Autowired
    private HotelRoomCollectFeign hotelRoomCollectFeign;

    @ApiOperation(value = "改变房间收藏状态")
    @RequestMapping("/change")
    public R changeRoomCollect(@RequestParam("collectStatus") Integer collectStatus, @RequestParam("roomId") Integer roomId) {

        return hotelRoomCollectFeign.changeRoomCollect(collectStatus, roomId);

    }

    @ApiOperation(value = "获取房间收藏状态")
    @RequestMapping("/getStatus")
    public R selectRoomCollect(@RequestParam("roomId") Integer roomId) {

        return hotelRoomCollectFeign.selectRoomCollect(roomId);

    }

    @ApiOperation(value = "展示用户收藏的房间")
    @RequestMapping("/show")
    public R showUserCollectRoom() {

        return hotelRoomCollectFeign.showUserCollectRoom();

    }

}
